package com.seleniti.enpareja.controller.model.integration.database.domain;

import java.util.Date;

import javax.jdo.annotations.Column;
import javax.jdo.annotations.Extension;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import javax.jdo.annotations.Version;
import javax.jdo.annotations.VersionStrategy;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
@Version(column = "version", strategy = VersionStrategy.VERSION_NUMBER, extensions = { @Extension(vendorName = "datanucleus", key = "field-name", value = "version") })
public class Food {

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	@Extension(vendorName = "datanucleus", key = "gae.encoded-pk", value = "true")
	private String foodId;

	@Column(allowsNull="false")
	@NotNull
	private Date date;

	@Column(allowsNull = "false")
	@NotNull
	private Couple couple;

	@Column(length=150)
	@Size(max=150)
	private String lunch;

	@Column(length=150)
	@Size(max=150)
	private String dinner;

	protected long version;

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public Couple getCouple() {
		return couple;
	}

	public void setCouple(Couple couple) {
		this.couple = couple;
	}

	public String getLunch() {
		return lunch;
	}

	public void setLunch(String lunch) {
		this.lunch = lunch;
	}

	public String getDinner() {
		return dinner;
	}

	public void setDinner(String dinner) {
		this.dinner = dinner;
	}

	public String getFoodId() {
		return foodId;
	}

	public void setFoodId(String foodId) {
		this.foodId = foodId;
	}

	@Override
	public String toString() {
		return "Food [foodId=" + foodId + ", date=" + date + ", lunch=" + lunch + ", dinner=" + dinner + "]";
	}

}
